Freshers / Beginner level questions
Freshers / Beginner level questions & answers
Ques 1. What is MongoDB?
MongoDB is a NoSQL database that provides high performance, high availability, and easy scalability. It stores data in flexible, JSON-like documents called BSON.
Ques 2. Explain the structure of a MongoDB document.
A MongoDB document is a JSON-like data structure composed of field-value pairs. Fields may contain other documents, arrays, and arrays of documents.
Ques 3. What is BSON?
BSON is a binary representation of JSON-like documents that MongoDB uses to store data. It adds support for data types like Date and Binary that are not natively supported in JSON.
Ques 4. What is a NoSQL database?
NoSQL databases are databases that provide a mechanism for storage and retrieval of data that is modeled in ways other than the tabular relations used in relational databases.
Ques 5. What is a MongoDB collection?
A collection in MongoDB is a group of MongoDB documents. It is equivalent to an RDBMS table.
Ques 6. What is the significance of the ObjectId in MongoDB?
ObjectId is a 12-byte identifier typically employed as the primary key in a MongoDB document. It consists of a timestamp, machine identifier, process ID, and a random incrementing value.
Ques 7. What is the purpose of the `findOne` method in MongoDB?
The `findOne` method in MongoDB is used to retrieve a single document that satisfies the specified query criteria. It returns the first document that matches the query.
Most helpful rated by users: